package com.cloudwise.servlet;

import com.cloudwise.service.PersonInfoService;
import com.cloudwise.service.impl.PersonInfoServiceimpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author ：Teacher陈
 * @date ：Created in 2021/1/25 14:42
 * @description：人员信息业务控制器
 * @modified By：
 * @version: 1
 */
@WebServlet(urlPatterns = "/ajax")
public class PersonInfoAjaxServlet extends HttpServlet {
    private PersonInfoService personInfoService = new PersonInfoServiceimpl();


    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String person_id = req.getParameter("person_id");
        String personName = personInfoService.findPersonName(person_id);
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(personName);
        resp.getWriter().print(personName);

    }
}
